package redora.test.rdo.gwt.mvp.service;

import com.google.gwt.json.client.JSONObject;

import redora.client.mvp.ClientFactory;

import redora.test.rdo.gwt.mvp.service.base.JUnitChildServiceBase;
import redora.test.rdo.gwt.mvp.util.ClientFactoryImpl;

/**
 * Service object for JUnitChild that will do the communication with the server.
 * Implemented as singleton to allow caching of objects on the client side.<br>
 * Redora has generated the standard service methods in {@link JUnitChildServiceBase},
 * you can add your custom methods here.
 *
 * @author Redora (www.redora.net)
 */
public class JUnitChildService extends JUnitChildServiceBase {

    //As singleton: allows to cache result sets and pojos
    private static JUnitChildService instance;

    private JUnitChildService(ClientFactory clientFactory) {
        super(clientFactory);
    }

    public static synchronized JUnitChildService getInstance() {
        if (instance == null)
            instance = new JUnitChildService(new ClientFactoryImpl());
        return instance;
    }

    @Override
    public int finderStepSize() {
        return 50;
    }

    @Override
    public String getAuthInfo() {
        return null;
    }

    @Override
    public boolean customResponse(int status, JSONObject responseJSON) {
        return true;
    }
}